<?php
/**
 * Created by PhpStorm.
 * User: dung
 * Date: 11/11/14
 * Time: 10:46 AM
 */

class Tone extends Eloquent
{
//    use SoftDeletingTrait;
//
//    protected $dates = ['deleted_at'];


    public function lyrics()
    {
        return $this->hasMany('Lyric', 'tone_id');
    }

    public function videos()
    {
        return $this->hasMany('Video', 'tone_id');
    }
    public function lessons()
    {
        return $this->hasMany('Lesson', 'tone_id');
    }

    public function saveItem($arrParams, $options = null)
    {
        $row = empty($arrParams['id']) ? new Tone() : $this->find($arrParams['id']);
        foreach ($arrParams as $key => $value) {
            $row->{$key} = $value;
        }
        $row->save();
        return $row->id;
    }
} 